Ok, I've been trying some work with dialog boxes and am getting very frustrated. Below is an example of one of the problems I've been running into. Running this results in this error -R-E- DXL: <Line:10> unassigned variable (dbeList) I found a workaround that stores the value of the list when it is set, but I was hoping for some insight into what I'm doing wrong and how I can fix it.
string dummyList[] = {"A","B","C"}
DB exBox = null
DBE dbeLabel = null
DBE dbeList = null
DBE dbeRun = null
Module m = current Module
string RFCnum = null
void Run(DB exBox) {
RFCnum = get(dbeList)
infoBox("You selected " RFCnum "")
hide(exBox)
}
exBox = create "Example Problem"
dbeLabel = label(exBox,"Select from list")
dbeList = list(exBox, "List:", 20,10,dummyList)
dbeRun = apply(exBox,"Run",Run)
realize(exBox)
iannacones1 - Mon Aug 02 09:05:34 EDT 2010 |
Re: Dialog box issue |
Re: Dialog box issue Use show(exBox) instead of realize, and your script will work ... |
Re: Dialog box issue ambes - Mon Aug 02 10:08:18 EDT 2010 Use show(exBox) instead of realize, and your script will work ... The documentation talks about show making the dialog box active, without defining what active means. In this case, treat active as a synonym for fully initialised. |
Re: Dialog box issue interesting, that defiantly helps but… what do I do if I do need to use realize
string dummyList[] = {""}
DB exBox = null
DBE dbeLabel = null
DBE dbeList = null
DBE dbeRun = null
Module m = current Module
string attSelect = null
string attName = null
int iList
int fillList(DBE dbeList) {
iList = 0
for attName in current Module do {
insert(dbeList,iList,attName)
iList++
}
return iList
}
void Run(DB exBox) {
attSelect = get(dbeList)
infoBox("You selected " attSelect "")
release(exBox)
}
exBox = create "Example Problem"
dbeLabel = label(exBox,"Select from list")
dbeList = list(exBox, "List:", 200,10,dummyList)
dbeRun = apply(exBox,"Run",Run)
realize(exBox)
if (fillList(dbeList) == 0) {
insert(dbeList, 0 , "(No Attributes)")
}
|
Re: Dialog box issue Ok, I got it... thanks you guys!
string dummyList[] = {""}
DB exBox = null
DBE dbeLabel = null
DBE dbeList = null
DBE dbeRun = null
Module m = current Module
string attSelect = null
string attName = null
int iList
int fillList(DBE dbeList) {
iList = 0
for attName in current Module do {
insert(dbeList,iList,attName)
iList++
}
return iList
}
void Run(DB exBox) {
attSelect = get(dbeList)
infoBox("You selected " attSelect "")
hide(exBox)
}
exBox = create "Example Problem"
dbeLabel = label(exBox,"Select from list")
dbeList = list(exBox, "List:", 200,10,dummyList)
dbeRun = apply(exBox,"Run",Run)
realize(exBox)
if (fillList(dbeList) == 0) {
insert(dbeList, 0 , "(No Attributes)")
}
show(exBox)
|